﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace OrganizationStructureTree.Models
{
    public class Node
    {
        [Key]
        public int ID { get; set; }

        public string Name { get; set; }

        public int? ParentID { get; set; }

        public int TreeID { get; set; }

        [ForeignKey("TreeID")]
        public virtual Tree Tree { get; set; }

        [ForeignKey("ParentID")]
        public virtual Node Parent { get; set; }

        public virtual List<Node> Children { get; set; }
    }
}